g01aef
g01aef
© Numerical Algorithms Group, 2002.
Purpose
G01AEF Frequency table from raw data
Synopsis
[cint,ifreq,xmin,xmax,ifail] = g01aef(x,iclass,cint<,ifail>)
Description
The data consists of a sample of n observations of a continuous
variable, denoted by x , for i=1,2,...,n. Let a=min(x ,...,x )
i 1 n
and b=max(x ,...,x ).
1 n
The routine constructs a frequency distribution with k(>1)
classes denoted by f , for i=1,2,...,k.
i
The boundary values may be either user-supplied, or routine-
calculated, and are denoted by y , for j=1,2,...,k-1.
j
If the boundary values of the classes are to be routine-
calculated, then they are determined in one of the following
ways:
(a) If k>2, the range of x values is divided into k-2 intervals
of equal length, and two extreme intervals, defined by the
class boundary values y ,y ,...,y .
1 2 k-1
1
(b) If k=2, y = -(a+b).
1 2
However formed, the values y ,...,y are assumed to be in
1 k-1
ascending order. The class frequencies are formed with
f = the number of x values in the interval (-infty,y )
1 1
f = the number of x values in the interval [y ,y ),
i k-1 k
i=2,....,k-1
f = the number of x values in the interval [y ,infty),
k k-1
where [ means inclusive, and ) means exclusive. If the class
boundary values are routine-calculated and k>2, then f =f =0, and
1 k
y and y are chosen so that y <a and y >b.
1 k-1 1 k-1
If a frequency distribution is required for a discrete variable,
then it is suggested that the user supplies the class boundary
values; routine-calculated boundary values may be slightly
imprecise (due to the adjustment of y and y outlined above)
1 k-1
and cause values very close to a class boundary to be assigned to
the wrong class.
Parameters
g01aef
Required Input Arguments:
x (:) real
iclass integer
cint (:) real
Optional Input Arguments: <Default>
ifail integer -1
Output Arguments:
cint (:) real
ifreq (:) integer
xmin real
xmax real
ifail integer